#FROM  bitnami/git:2.46.0  AS gitclone
FROM  registry.cn-hangzhou.aliyuncs.com/baimeidashu/git:2.46.0  AS gitclone
ARG url=https://gitee.com/wang-huamao/flaskStockCycle.git
ARG appName=flaskStockCycle
RUN git clone $url
RUN mv $appName  /app



#2 提前准备匹配库



#3 使用官方的Python运行时作为父镜像
FROM registry.cn-hangzhou.aliyuncs.com/baimeidashu/python:3.8.20 AS prepare
##第2部分： 维护者信息
LABEL  mainatiner="baimeidashu"
#设置工作目录为/app
WORKDIR /app

COPY --from=gitclone  /app   /app

RUN cat /app/requirements.txt

## 安装依赖
RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple  &&  pip install --upgrade pip


RUN pip install --no-cache-dir -r /app/requirements.txt




RUN ls -l

# 将/etc/localtime链接到上海时区文件
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

#暴露的端口号与入口文件定义的端口号保持一致
EXPOSE 5000


##第4部分： CMD 命令
# 当容器启动时运行python demo1.py
CMD ["python","cycle.py"]